package oop.ex2.filters;

import java.io.*;
//TODO - check school solution to see if this is what required. if it is
// some redesign should be made - most of code could be found at WildCardFilter.

/**
 * Filter of file name and path checked using wild card.
 */
class SubDirWildcardFilter extends WildCardFilter {
	//***********************************************************************
	//  Methods :                                                           *
	//***********************************************************************
	/**
	 * Constructs a new wild card path filter.	 
	 */
	public SubDirWildcardFilter(){
		super();
	}
	/**
	 *  Clones the object - return a new object with same properties.
	 */
    public Filter clone() {
        return new SubDirWildcardFilter();
    }
    /**
     * Returns File's relevant data.
     * @return File's relevant data, or null if the file doesn't hold the filter
     * condition (Check directory on non directory file).
     */
    public String[] getFileData(){
 	    String path = _file.getAbsolutePath();
 	    String[] splitted = path.split(File.separatorChar+"");
 	    return splitted;
    }
}

